package com.bigger.config;

import feign.Logger;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class CloudConfiguration {
    /**
     * 设置feign日志级别
     * @return
     */
    @Bean
    public Logger.Level loglever(){
        return Logger.Level.BASIC;
    }
    /**
     * 发起http请求的RestTemplate
     * 用于异步获取信息
     * @return
     */
    @Bean
    @LoadBalanced //负载均衡注释
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
